Data Migration Method and Apparatus

ABSTRACT

The present application relates to a data migration method and an apparatus, which are applied to a scenario in which a user plane gateway communicating with a terminal is changed from a source user plane gateway to a target user plane gateway. The target user plane gateway receives an address of the terminal from a control plane gateway, obtains an Ethernet data packet based on the address of the terminal, and sends the Ethernet data packet to an Ethernet interface, so that a switch obtains the Ethernet data packet through the Ethernet interface, and updates a MAC address table based on the Ethernet data packet. Thus, the switch updates the MAC address table in a timely manner, and the switch can send, through a correct port based on an updated MAC address table, downlink data to the terminal, to effectively prevent a loss of the downlink data.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of International Application No. PCT/CN2016/106060, filed on Nov. 16, 2016, which is hereby incorporated by reference in their entireties.

TECHNICAL FIELD

Embodiments of the present application relate to the field of communications technologies, and in particular, to a data migration method and an apparatus.

BACKGROUND

In processes in which a terminal sends and receives Ethernet-type data by using a mobile network such as 4G or 5G, the data needs to be received and forwarded by using a corresponding Ethernet switch. As shown in FIG. 1a , the Ethernet switch is a switch that transmits data based on an Ethernet address. Each port of the Ethernet switch is directly connected to a host, and the Ethernet switch usually operates in a full-duplex mode. The switch can connect many pairs of ports at the same time, so that each pair of hosts that communicate with each other can perform conflict-free data transmission in a manner like that of exclusively occupying a communications medium.

When receiving an Ethernet frame that needs to be forwarded, the Ethernet switch searches a Media Access Control (MAC) address table based on a destination MAC address in a frame header of the Ethernet frame, to obtain a port that corresponds to the destination MAC address and that is on the Ethernet switch, and then forwards the Ethernet frame through the port, so as to implement data exchange. If the destination MAC address is not in the MAC address table, the Ethernet switch “floods” the Ethernet frame to all ports. When a port for communication between a receive end and the Ethernet switch changes, the Ethernet switch updates the MAC address list by using an Address Resolution Protocol (ARP) Ethernet frame or a null data packet (NDP) Ethernet frame.

When the terminal and an evolved packet system (EPS) establish a session connection supporting an Ethernet-type packet data network (Packet Data Network, PDN), after the terminal is attached to the EPS, the terminal sends an Ethernet frame by using a general packet radio service (GPRS) tunneling protocol (GTP) tunnel of the EPS, a user plane gateway (UP GW) sends the Ethernet frame to an SGi interface, and the Ethernet switch obtains the Ethernet frame from the SGi interface. However, when the terminal moves, the EPC possibly switches the user plane gateway performing a session with the terminal. In this case, because the address list of the Ethernet switch is not updated in a timely manner, the Ethernet switch still continues to forward, to a source UP GW in a short time, a downlink Ethernet frame to be sent to the terminal. Consequently, a target UP GW serving the terminal cannot obtain the downlink Ethernet frame to be sent to the terminal, resulting in a data loss.

SUMMARY

The present application provides a data migration method and an apparatus, to overcome a data loss problem caused in a migration process of an Ethernet-type data connection in the related art.

According to a first aspect, a data migration method is provided, and when a control plane gateway switches a user plane gateway communicating with a terminal from a source user plane gateway to a target user plane gateway, the method includes: receiving, by the target user plane gateway, an address of the terminal that is sent by the control plane gateway; obtaining, by the target user plane gateway, an Ethernet data packet based on the address of the terminal, where the Ethernet data packet includes uplink data sent by the terminal or an Address Resolution Protocol ARP packet; and sending, by the target user plane gateway, the Ethernet data packet to an Ethernet interface, so that a switch obtains the Ethernet data packet through the Ethernet interface, and updates a Media Access Control MAC address table based on the Ethernet data packet.

In this way, the switch can obtain the ARP packet or the uplink data through the Ethernet interface, update the Media Access Control MAC address table based on the ARP packet or the uplink data, and change a port for sending data to the terminal, to avoid a loss of downlink data to be sent to the terminal.

In a possible design, the method further includes: obtaining, by the target user plane gateway by using a unidirectional transmission channel, first downlink data sent by the source user plane gateway, where the unidirectional transmission channel is a unidirectional temporary transmission tunnel established between the source user plane gateway and the target user plane gateway; and sending, by the target user plane gateway, the first downlink data to the terminal based on the address of the terminal.

In this way, a problem such as a loss or a sending latency of the downlink data to be sent to the terminal that is caused because the MAC address table in the switch fails to be updated in a timely manner can be avoided.

In a possible design, the method further includes: obtaining, by the target user plane gateway through the Ethernet interface, second downlink data to be sent to the terminal, where the second downlink data carries an address of the terminal; and releasing, by the target user plane gateway, the unidirectional transmission channel if the address of the terminal that is carried in the second downlink data successfully matches the address of the terminal that is sent by the control plane gateway.

When the address of the terminal that is carried in the second downlink data matches the address of the terminal that is sent by the control plane gateway, it may be determined that the MAC address table in the switch has been updated. In this case, the target user plane gateway may release the transmission channel between the source user plane gateway and the target user plane gateway.

In a possible design, the address of the terminal includes at least one of an IP address of the terminal and a MAC address of the terminal.

In a possible design, the obtaining, by the target user plane gateway, an Ethernet data packet based on the address of the terminal includes: receiving, by the target user plane gateway, an ARP packet sent by the terminal that includes the address of the terminal; or generating, by the target user plane gateway, an ARP packet including the address of the terminal.

In a possible design, the address of the terminal is the IP address, and the obtaining, by the target user plane gateway based on the address of the terminal, an ARP packet sent by the terminal includes: sending, by the target user plane gateway, an ARP request message to the terminal, where the ARP request message includes the IP address of the terminal and a source MAC address, and the source MAC address is a broadcast MAC address; and receiving, by the target user plane gateway, the ARP packet sent by the terminal, where the ARP packet carries a destination MAC address of the terminal, and the destination MAC address is the source MAC address included in the ARP request message.

In a possible design, the obtaining, by the target user plane gateway based on the address of the terminal, an ARP packet sent by the terminal includes: receiving, by the target user plane gateway, a free ARP packet sent by the terminal, where if the free ARP packet carries the address of the terminal, the free APR packet is the ARP packet sent by the terminal.

In a possible design, the target user plane gateway is located in an evolved packet system EPS, and the Ethernet interface is an SGi interface; or the target user plane gateway is located in a next generation NexGen system, and the Ethernet interface is an NG6 interface.

According to a second aspect, a data migration method is further provided, and the method includes: obtaining, by a control plane gateway, a MAC address of a terminal; and sending, by the control plane gateway, the MAC address of the terminal to the target user plane gateway.

According to a third aspect, a user plane gateway is provided, and is applied to a scenario in which a user plane gateway communicating with a terminal is changed from a source user plane gateway to the user plane gateway, and the user plane gateway includes: a receiving unit, configured to receive an address of the terminal that is sent by a control plane gateway; a processing unit, configured to obtain an Ethernet data packet based on the address of the terminal that is received by the receiving unit, where the Ethernet data packet includes uplink data sent by the terminal or an Address Resolution Protocol ARP packet; and a sending unit, configured to send the Ethernet data packet obtained by the processing unit to an Ethernet interface, so that a switch obtains the Ethernet data packet through the Ethernet interface, and updates a Media Access Control MAC address table based on the Ethernet data packet.

In a possible design, the receiving unit is further configured to obtain, by using a unidirectional transmission channel, first downlink data sent by the source user plane gateway, where the unidirectional transmission channel is a unidirectional temporary transmission tunnel established between the source user plane gateway and the user plane gateway; and the sending unit is further configured to send the first downlink data to the terminal based on the address of the terminal that is received by the receiving unit.

In a possible design, the receiving unit is further configured to obtain, through the Ethernet interface, second downlink data to be sent to the terminal, where the second downlink data carries an address of the terminal; and the processing unit is configured to release the unidirectional transmission channel if the address of the terminal that is carried in the second downlink data received by the receiving unit successfully matches the address of the terminal that is sent by the control plane gateway.

In a possible design, the address of the terminal includes at least one of an IP address of the terminal and a MAC address of the terminal.

In a possible design, the receiving unit is further configured to receive an ARP packet sent by the terminal that includes the address of the terminal; or the processing unit is further configured to generate an ARP packet including the address of the terminal.

In a possible design, the address of the terminal is the IP address; the sending unit is further configured to send an ARP request message to the terminal, where the ARP request message includes the IP address of the terminal and a source MAC address, and the source MAC address is a broadcast MAC address; and the receiving unit is further configured to receive the ARP packet sent by the terminal, where the ARP packet carries a destination MAC address of the terminal, and the destination MAC address is the source MAC address included in the ARP request message.

In a possible design, the receiving unit is further configured to receive a free ARP packet sent by the terminal, where if the free ARP packet carries the address of the terminal, the free APR packet is the ARP packet sent by the terminal.

In a possible design, the user plane gateway is located in an evolved packet system EPS, and the Ethernet interface is an SGi interface; or the user plane gateway is located in a next generation NexGen system, and the Ethernet interface is an NG6 interface.

According to a fourth aspect, a control plane gateway is further provided, and the control plane gateway includes: a processing unit, configured to obtain a MAC address of a terminal; and a sending unit, configured to send, to the target user plane gateway, the MAC address of the terminal that is obtained by the processing unit.

BRIEF DESCRIPTION OF DRAWINGS

The accompanying drawings herein are incorporated in the specification, become a part of the specification, show embodiments that are in accordance with the present application, and are used with the specification to explain a principle of the present application.

FIG. 1a is a schematic diagram of an application scenario of an Ethernet switch;

FIG. 1b is a schematic diagram of an application scenario according to an embodiment of the present application;

FIG. 2 is a flowchart of a data migration method according to another embodiment of the present application;

FIG. 3 is a flowchart of a data migration method according to another embodiment of the present application;

FIG. 4 is a flowchart of a data migration method according to another embodiment of the present application;

FIG. 5 is a flowchart of step S220 according to an embodiment of the present application;

FIG. 6 is a flowchart of step S221 according to an embodiment of the present application;

FIG. 7 is a flowchart of a data migration method according to another embodiment of the present application;

FIG. 8 is a signaling flowchart of a data migration method according to another embodiment of the present application;

FIG. 9 is a signaling flowchart of a data migration method according to another embodiment of the present application;

FIG. 10 is a signaling flowchart of a data migration method according to another embodiment of the present application;

FIG. 11 is a signaling flowchart of a data migration method according to another embodiment of the present application;

FIG. 12 is a schematic structural diagram of a user plane gateway according to an embodiment of the present application;

FIG. 13 is a schematic diagram of a data migration apparatus according to an embodiment of the present application; and

FIG. 14 is a schematic structural diagram of a control plane gateway according to an embodiment of the present application.

DESCRIPTION OF EMBODIMENTS

The following describes the embodiments of the present application with reference to the accompanying drawings.

To enhance network flexibility and scalability, function items in an EPC are usually divided into a control plane gateway and a user plane gateway. The user plane gateway is mainly used to process a data packet. The control plane gateway is mainly used to define a processing action performed by the user plane gateway on the data packet. The control plane gateway sends a processing rule (rule) of the data packet to the user plane gateway. When the data packet arrives at the user plane gateway, the user plane gateway performs corresponding processing on the data packet according to the processing rule delivered by the control plane gateway, so as to complete processing, sending, and the like for the data packet of a terminal.

FIG. 1b is a schematic diagram of an application scenario according to an embodiment of the present application. As shown in FIG. 1b , when a terminal 300 is located at a location A, the terminal communicates with a base station 100, and the terminal 300 sends data to or receives data from a source user plane gateway 500 by using the base station 100. The source user plane gateway 500 may send data to an Ethernet interface, or the source user plane gateway 500 obtains data sent by an Ethernet interface. Likewise, a switch 700 may obtain data from the Ethernet interface, or send data to the Ethernet interface. In other words, the source user plane gateway 500 communicates with the switch 700 through the Ethernet interface. Likewise, a target user plane gateway 600 may also communicate with the switch 700 through an Ethernet interface. For example, in an evolved packet system (EPS), the Ethernet interface is an SGi interface; or in a next generation (NexGen) system, the Ethernet interface is an NG6 interface.

When the terminal 300 moves from the location A in FIG. 1b to a location B, cell handover or cell reselection may occur. In this case, a base station communicating with the terminal 300 is changed from the base station 100 to a base station 200. To optimize a communication path between the terminal and a user plane gateway, a control plane gateway 400 switches the user plane gateway communicating with the terminal 300 from the source user plane gateway 500 to the target user plane gateway 600. However, in the prior art, in this case, because a MAC address table in the switch 700 is not updated in a timely manner, the switch 700 continues to send downlink data to the source user plane gateway based on the MAC address table that is not updated. Consequently, in this case, the target user plane gateway performing a session with the terminal 300 cannot obtain the downlink data that needs to be sent to the terminal, resulting in a data loss.

To resolve the foregoing problem in the prior art, the present application provides a data migration method and an apparatus.

With reference to FIG. 1b , when the control plane gateway 400 switches the user plane gateway communicating with the terminal 300 from the source user plane gateway 500 to the target user plane gateway 600, the control plane gateway 400 obtains an address of the terminal 300. The address of the terminal may be an IP address or a MAC address of the terminal, or may be an IP address and a MAC address of the terminal. A manner in which the control plane gateway 400 obtains the address of the terminal 300 may be that the control plane gateway 400 obtains the address from a context of the terminal that is stored in the control plane gateway 400, or the control plane gateway 400 obtains the address from the source user plane gateway 500, or the control plane gateway 400 obtains the address from signaling of the terminal 300, or the like.

The control plane gateway 400 sends the obtained address of the terminal 300 to the target user plane gateway 600. When the target user plane gateway 600 obtains the address of the terminal 300 that is sent by the control plane gateway 400, the target user plane gateway 600 obtains, based on the address of the terminal 300, uplink data sent by the terminal 300. The uplink data carries the MAC address of the terminal.

The target user plane gateway 600 sends, to an Ethernet interface communicating with the switch 700, the uplink data sent by the terminal 300, and the switch 700 obtains, from the Ethernet interface, the uplink data sent by the terminal. The switch 700 updates the MAC address table in the switch 700 by obtaining the MAC address of the terminal in the uplink data and a port communicating with the target user plane gateway. In addition, the switch 700 may further determine, based on the MAC address of the terminal that is carried in the uplink data and a port address corresponding to the switch 700, whether the MAC address table in the switch 700 is updated, and update the MAC address table if the MAC address table is not updated. In this way, in this embodiment of the present application, the MAC address table in the switch is updated in a timely manner, and when the user plane gateway communicating with the terminal changes, the switch may switch, in a timely manner based on an updated MAC address table, a communications port for sending data to the terminal, so as to ensure that the downlink data to be sent to the terminal is not lost.

In addition, the target user plane gateway 600 may further obtain an ARP packet, and the ARP packet carries the IP address and the MAC address of the terminal. The target user plane gateway 600 sends the ARP packet to the switch 700 through the Ethernet interface, and the switch 700 updates the address list based on the ARP packet and a corresponding communications port address.

A manner in which the target user plane gateway 600 obtains the ARP packet may include but is not limited to the following:

In a first manner, the control plane gateway 400 sends a MAC address update indication to the terminal 300, and the terminal 300 generates, based on the received MAC address update indication, an Address Resolution Protocol (ARP) packet including the MAC address of the terminal 300. The ARP packet may be a free ARP packet. The terminal 300 sends the ARP packet to the target user plane gateway 600, and the target user plane gateway 600 receives the ARP packet sent by the terminal 300. The target user plane gateway 600 parses a received ARP packet, and determines, as the ARP packet sent by the terminal 300, an ARP packet that matches the MAC address of the terminal 300 in received APR packets.

In a second manner, the target user plane gateway 600 sends an ARP request including the address of the terminal 300 to the terminal 300, and the ARP request is used to request to use a broadcast MAC address as a source MAC address of ARP request. When the terminal 300 receives the ARP request sent by the target user plane gateway 600, the terminal 300 sends an ARP response packet to the target user plane gateway 600, and the target user plane gateway 600 receives the ARP response packet sent by the terminal 300. A destination MAC address of the terminal 300 that is carried in the ARP response packet is the source MAC address of the ARP request. The ARP response packet is the ARP packet sent by the terminal 300. The target user plane gateway 600 forwards the ARP packet to the switch 700, and the switch 700 updates the MAC address table based on the received ARP packet.

In a third manner, the target user plane gateway 600 generates an ARP packet carrying the address of the terminal, and forwards the ARP packet to the switch 700. The switch 700 updates the MAC address table based on the received ARP packet.

With reference to FIG. 1b , first downlink data that is sent by the switch 700 to the source user plane gateway 500 before the switch 700 updates the MAC address table is forwarded to the target user plane gateway 600, so that the target user plane gateway 600 can send the first downlink data to the terminal 300 in a timely manner, to avoid a loss of the first downlink data. With reference to the foregoing embodiments, in another embodiment provided in the present application, a unidirectional temporary transmission tunnel is established between the source user plane gateway 500 and the target user plane gateway 600, and data can be sent only from the source user plane gateway 500 to the target user plane gateway 600. The unidirectional temporary transmission tunnel may be pre-established, or may be established at any time as required. This is not limited in this embodiment of the present application.

It should be noted that the unidirectional temporary transmission tunnel is established when the MAC address table in the switch 700 is updated. When the control plane gateway 400 switches the user plane gateway communicating with the terminal 300 from the source user plane gateway 500 to the target user plane gateway 600, the unidirectional temporary transmission tunnel is used to temporarily transmit downlink data in the source user plane gateway 500 that needs to be sent to the terminal 300. In this case, the source user plane gateway 500 sends the downlink data to the target user plane gateway 600 through the established unidirectional temporary transmission tunnel. After the target user plane gateway 600 receives the downlink data, the target user plane gateway 600 sends the downlink data to the terminal 300, to avoid a loss of the downlink data that is caused because when the control plane gateway 400 switches the user plane gateway communicating with the terminal 300, the switch 700 fails to update the address table in a timely manner, and the switch still sends the downlink data to the source user plane gateway 500.

In another embodiment provided in the present application, a data migration method is further provided. The method is applied to a scenario in which a user plane gateway communicating with a terminal is changed from a source user plane gateway to a target user plane gateway. As shown in FIG. 2, an execution procedure on a target user plane gateway side includes the following steps.

In step S210, the target user plane gateway receives an address of the terminal that is sent by a control plane gateway.

The address of the terminal may be an IP address of the terminal, or a MAC address of the terminal, or an IP address and a MAC address of the terminal.

In step S220, the target user plane gateway obtains an Ethernet data packet based on the address of the terminal.

The Ethernet data packet includes uplink data sent by the terminal or an ARP packet. The APR packet may be an ARP packet sent by the terminal that is received by the target user plane gateway and that includes the address of the terminal, or an ARP packet that is generated by the target user plane gateway and that includes the address of the terminal. In addition, the target user plane gateway may alternatively receive uplink data sent by the terminal that includes the address of the terminal.

The target user plane gateway parses received uplink data, and determines, as the uplink data sent by the terminal, uplink data including the address of the terminal. The target user plane gateway determines, as the ARP packet sent by the terminal, an ARP packet that includes the address of the terminal in received ARP packets.

The target user plane gateway determines, as the uplink data sent by the terminal, the uplink data including the address of the terminal. In addition, the target user plane gateway may obtain the APR packet in the foregoing three ARP packet obtaining manners, and details are not described herein. For details, refer to the foregoing embodiment.

It should be noted that the embodiments provided in the present application may be correlatively combined and mutually explained.

In step S230, the target user plane gateway sends the Ethernet data packet to an Ethernet interface.

The target user plane gateway obtains the Ethernet data packet based on the address of the terminal. Specifically, the target user plane gateway may receive the uplink data sent by the terminal that includes the address of the terminal, or receive the ARP packet sent by the terminal that includes the address of the terminal. In addition, the target user plane gateway may alternatively generate the ARP packet including the address of the terminal. In this way, when obtaining, through the Ethernet interface, the ARP packet that is sent by the target user plane gateway and that includes the address of the terminal, or the uplink data that is sent by the target user plane gateway and that includes the address of the terminal, an Ethernet switch can update a MAC address table in a timely manner, and forward downlink data for the terminal to the target user plane gateway based on an updated MAC address table, to avoid a data loss.

The target user plane gateway is located in an evolved packet system EPS, and the Ethernet interface is an SGi interface; or the target user plane gateway is located in a next generation NexGen system, and the Ethernet interface is an NG6 interface.

For details of the method in FIG. 2, in another embodiment provided in the present application, as shown in FIG. 3, the method may further include the following steps:

In step S240, the target user plane gateway obtains, by using a unidirectional transmission channel, first downlink data sent by the source user plane gateway.

The transmission channel is a unidirectional temporary transmission tunnel established between the source user plane gateway and the target user plane gateway.

In step S250, the target user plane gateway sends the first downlink data to the terminal based on the address of the terminal.

Referring to FIG. 1b , a transmission tunnel used for unidirectional temporary data transmission is established between the source user plane gateway 500 and the target user plane gateway 600. Downlink data in the source user plane gateway 500 that needs to be sent to the terminal 300 is sent to the target user plane gateway 600 through the unidirectional temporary transmission tunnel. After the target user plane gateway receives the downlink data, the target user plane gateway sends the downlink data to the terminal 300, to avoid a problem such as a loss or a sending latency of the downlink data to be sent to the terminal that is caused because the MAC address table in the switch fails to be updated in a timely manner. The first downlink data includes the address of the terminal.

For details of the method in FIG. 3, in another embodiment provided in the present application, as shown in FIG. 4, the method may further include the following steps:

In step S260, the target user plane gateway obtains, through the Ethernet interface, second downlink data to be sent to the terminal.

The second downlink data carries an address of the terminal.

In step S270, the target user plane gateway matches an address of the terminal that is carried in the second downlink data against the address of the terminal that is sent by the control plane gateway.

In step S280, the target user plane gateway releases the unidirectional transmission channel if the address of the terminal that is carried in the second downlink data successfully matches the address of the terminal that is sent by the control plane gateway.

When the address of the terminal that is carried in the second downlink data matches the address of the terminal that is sent by the control plane gateway, it may be determined that the MAC address table in the switch has been updated. In this case, the target user plane gateway may release the transmission channel between the source user plane gateway and the target user plane gateway.

In this embodiment, the target user plane gateway mainly determines, by obtaining the second downlink data to be sent to the terminal, and matching the address of the terminal that is carried in the second downlink data against the address of the terminal that is obtained from the control plane gateway, whether the MAC address table in the switch is updated. If it is determined that the MAC address table in the switch is not updated, the switch still sends downlink data to the source user plane gateway based on an address in the MAC address table that is not updated. In this case, the source user plane gateway may send, to the target user plane gateway through the established unidirectional temporary transmission tunnel, the downlink data sent by the switch. After receiving the downlink data, the target user plane gateway sends the downlink data to the terminal, to avoid a data loss.

When the target user plane gateway determines, in the foregoing manner, that the MAC address table in the switch has been updated, it indicates that the switch can correctly send, to the target user plane gateway based on an updated MAC address table, downlink data to be sent to the terminal. In this case, the downlink data does not need to be transmitted through the established unidirectional temporary transmission tunnel, and then the target user plane gateway may release the unidirectional temporary transmission tunnel, or initiate an execution procedure of releasing the unidirectional temporary transmission tunnel.

For details of the method in FIG. 2, in another embodiment provided in the present application, as shown in FIG. 5, step S220 may further include the following steps:

In step S221, the target user plane gateway obtains an ARP packet sent by the terminal that includes the address of the terminal.

The target user plane gateway parses a received ARP packet to obtain an address, and when the ARP packet includes the address of the terminal, determines the received packet as the ARP packet sent by the terminal.

Alternatively, in step S222, the target user plane gateway generates an ARP packet including the address of the terminal.

That the target user plane gateway obtains the ARP packet sent by the terminal or generates the ARP packet is described in detail in the foregoing embodiment, and details are not described herein again.

For details of the method in FIG. 5, in another embodiment provided in the present application, as shown in FIG. 6, the address of the terminal is the IP address, and step S221 may further include the following steps:

In step S2211, the target user plane gateway sends an ARP request message to the terminal based on the IP address of the terminal.

A source MAC address of the ARP request message is a broadcast MAC address. The APR request carries the IP address of the terminal.

In step S2212, the target user plane gateway receives the ARP packet sent by the terminal.

The target user plane gateway receives an ARP response packet sent by the terminal, the ARP response packet includes the IP address of the terminal and the source MAC address, and the source MAC address is the broadcast MAC address. The target user plane gateway parses an ARP packet, and determines an APR packet including the address of the terminal as the ARP packet sent by the terminal.

For details, refer to a detailed description in the foregoing embodiment. Details are not described herein again.

In another embodiment provided in the present application, as shown in FIG. 7, a data migration method is provided. The method is applied to a scenario in which a user plane gateway communicating with a terminal is changed from a source user plane gateway to a target user plane gateway, and the method includes the following steps:

In step S710, a control plane gateway obtains a MAC address of the terminal.

In step S720, the control plane gateway sends the MAC address of the terminal to the target user plane gateway.

A manner in which the control plane gateway obtains the address of the terminal may be that the control plane gateway obtains the address from a context of the terminal that is stored in the control plane gateway, or the target user plane gateway obtains the address from the source user plane gateway, or the target user plane gateway obtains the address from signaling used for communication with the terminal, or the like.

Based on the foregoing descriptions of the method embodiments, a person skilled in the art may clearly understand that the present application may be implemented by software in addition to a necessary universal hardware platform or by hardware only. In most circumstances, the former is a better implementation. Based on such an understanding, the technical solutions of the present application essentially, or the part contributing to the prior art may be implemented in a form of a software product. The software product is stored in a storage medium, and includes several instructions for instructing a computer device (which may be a personal computer, a server, a network device, or the like) to perform all or some of the steps of the methods described in the embodiments of the present application. The foregoing storage medium includes: any medium that can store program code, such as a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc.

To describe implementation processes of the foregoing embodiments in detail, the following embodiments provided in the present application are respectively corresponding to the foregoing embodiments. It should be noted that the embodiments provided in the present application may be mutually explained, mutually supplemented, and mutually combined.

To describe in detail a process in which the target user plane gateway 600 sends, to the switch 700, uplink data sent by the terminal, so that the switch 700 can update a MAC address table in a timely manner based on the uplink data, in an embodiment provided in the present application, as shown in FIG. 8, a data migration method is provided, and includes the following steps:

In step 801, a terminal sends a switch (Handover/Handoff, HO)/tracking area update (TAU) request to a control plane gateway.

In step 802, when receiving the HO/TAU request sent by the terminal, the control plane gateway sends a MAC address of the terminal to a target user plane gateway.

The control plane gateway sends the MAC address of the terminal to the target user plane gateway in a packet data network (PDN) session.

In step 803, the terminal sends, to the target user plane gateway, uplink data including an address of the terminal.

In step 804, the control plane gateway sends a HO/TAU response to the terminal.

In step 805, the target user plane gateway sends, to a switch, the received uplink data sent by the terminal.

In step 806, the switch updates a MAC address table based on the uplink data sent by the target user plane gateway, and changes a port for sending data to the terminal.

In step 807, the target user plane gateway receives downlink data for the terminal that is sent by the switch.

In step 808, the target user plane gateway sends the downlink data to the terminal, where the downlink data includes the address of the terminal.

In step 809, the target user plane gateway sends, to the control plane gateway, information indicating that the MAC address table in the switch is updated.

According to the data migration method provided in this embodiment of the present application, the target user plane gateway obtains, based on the address of the terminal, the uplink data sent by the terminal, where the uplink data includes the address of the terminal, and the target user plane gateway sends the uplink data to an Ethernet interface, so that the switch obtains the uplink data through the Ethernet interface, and updates the MAC address table based on the uplink data. In this way, the switch updates the MAC address table in a timely manner, and the switch can send, through a correct port based on an updated MAC address table, downlink data that needs to be sent to the terminal, to effectively prevent a loss of the downlink data to be sent to the terminal.

To describe in detail a process in which the target user plane gateway 600 sends an ARP packet request to the terminal 300, and the target user plane gateway 600 sends, to the switch 700, an ARP response packet received from the terminal 300, so that the switch 700 updates a MAC address table based on the ARP response packet, in an embodiment provided in the present application, as shown in FIG. 9, a data migration method is provided, and includes the following steps.

In step 901, a terminal sends a HO/TAU request to a control plane gateway.

In step 902, the control plane gateway sends an address of the terminal to a target user plane gateway in a PDN session.

In step 903, the control plane gateway sends a HO/TAU response to the terminal.

In step 904, the target user plane gateway sends an ARP request to the terminal, where the ARP request carries an IP address of the terminal.

In step 905, the terminal sends an ARP response to the target user plane gateway, where the ARP response includes the IP address and a MAC address of the terminal.

In step 906, the target user plane gateway sends the ARP response to a switch.

In step 907, the switch updates a MAC address table based on the ARP response, and changes a port for sending data to the terminal.

According to the data migration method provided in this embodiment of the present application, the target user plane gateway obtains, based on the address of the terminal, an ARP packet sent by the terminal, where the ARP packet includes the address of the terminal, and the target user plane gateway sends the ARP packet to an Ethernet interface, so that the switch obtains the ARP packet through the Ethernet interface, and updates the MAC address table based on the ARP packet. In this way, the switch updates the MAC address table in a timely manner, and the switch can send, through a correct port based on an updated MAC address table, downlink data that needs to be sent to the terminal, to effectively prevent a loss of the downlink data to be sent to the terminal.

To describe in detail a process in which the target user plane gateway 600 sends a free ARP packet generated by the terminal 300 to the switch 700, so that the switch 700 updates a MAC address table based on the free ARP packet, in an embodiment provided in the present application, as shown in FIG. 10, a data migration method is provided, and includes the following steps.

In step 1001, a terminal sends a HO/TAU request to a control plane gateway.

In step 1002, the control plane gateway sends a HO/TAU response to the terminal.

In step 1003, the control plane gateway sends an address of the terminal to a target user plane gateway in a PDN session.

The address of the terminal includes an IP address and a MAC address of the terminal.

In step 1004, the terminal sends an ARP packet to the target user plane gateway.

The ARP packet carries the address of the terminal, and the ARP packet is a free ARP packet.

In step 1005, the target user plane gateway sends, to a switch, the ARP packet sent by the terminal.

In step 1006, the switch updates a MAC address table based on the ARP packet, and changes a port for sending data to the terminal.

According to the data migration method provided in this embodiment of the present application, the target user plane gateway obtains, based on the address of the terminal, the ARP packet sent by the terminal, where the ARP packet includes the address of the terminal, and the target user plane gateway sends the ARP packet to an Ethernet interface, so that the switch obtains the ARP packet through the Ethernet interface, and updates the MAC address table based on the ARP packet. In this way, the switch updates the MAC address table in a timely manner, and the switch can send, through a correct port based on an updated MAC address table, downlink data that needs to be sent to the terminal, to effectively prevent a loss of the downlink data to be sent to the terminal.

To describe in detail a process in which the target user plane gateway 600 generates an ARP packet, and sends the ARP packet to the switch 700, so that the switch 700 updates a MAC address table based on the ARP packet, in an embodiment provided in the present application, as shown in FIG. 11, a data migration method is provided, and includes the following steps.

In step 1101, a terminal sends a HO/TAU request to a control plane gateway.

In step 1102, the control plane gateway sends a HO/TAU response to the terminal.

In step 1103, the control plane gateway sends an IP address and a MAC address of the terminal to the target user plane gateway in a PDN session.

In step 1104, the target user plane gateway generates an ARP packet including the MAC address of the terminal.

In step 1105, the target user plane gateway sends the ARP packet to a switch.

In step 1106, the switch updates a MAC address table based on the ARP packet, and changes a port for sending data to the terminal.

According to the data migration method provided in this embodiment of the present application, the target user plane gateway generates, based on the address of the terminal, the ARP packet including the address of the terminal, and the target user plane gateway sends the ARP packet to an Ethernet interface, so that the switch obtains the ARP packet through the Ethernet interface, and updates the MAC address table based on the ARP packet. In this way, the switch updates the MAC address table in a timely manner, and the switch can send, through a correct port based on an updated MAC address table, downlink data that needs to be sent to the terminal, to effectively prevent a loss of the downlink data to be sent to the terminal.

In addition, in an implementation of the foregoing embodiments, an embodiment of the present application further provides a user plane gateway, applied to a scenario in which a user plane gateway communicating with a terminal is changed from a source user plane gateway to the user plane gateway. The user plane gateway may be configured to perform an action performed by the target user plane gateway in the embodiment shown in any one of FIG. 2 to FIG. 11. As shown in FIG. 12, the user plane gateway includes: a receiving unit 11, configured to receive an address of the terminal that is sent by a control plane gateway; a processing unit 12, configured to obtain an Ethernet data packet based on the address of the terminal that is received by the receiving unit 11, where the Ethernet data packet includes uplink data sent by the terminal or an Address Resolution Protocol ARP packet; and a sending unit 13, configured to send the Ethernet data packet obtained by the processing unit 12 to an Ethernet interface, so that a switch obtains the Ethernet data packet through the Ethernet interface, and updates a MAC address table based on the Ethernet data packet.

In this way, the switch can obtain the ARP packet or the uplink data through the Ethernet interface, update the Media Access Control MAC address table based on the ARP packet or the uplink data, and change a port for sending data to the terminal, to avoid a loss of downlink data to be sent to the terminal.

In another embodiment provided in the present application, the receiving unit 11 is further configured to obtain, by using a unidirectional transmission channel, first downlink data sent by the source user plane gateway, where the unidirectional transmission channel is a unidirectional temporary transmission tunnel established between the source user plane gateway and the target user plane gateway; and the sending unit 13 is further configured to send the first downlink data to the terminal based on the address of the terminal that is received by the receiving unit 11.

In this way, a problem such as a loss or a sending latency of the downlink data to be sent to the terminal that is caused because the MAC address table in the switch fails to be updated in a timely manner can be avoided.

In another embodiment provided in the present application, the receiving unit 11 is further configured to obtain, through the Ethernet interface, second downlink data to be sent to the terminal, where the second downlink data carries an address of the terminal; and the processing unit 12 is further configured to release, by the target user plane gateway, the unidirectional transmission channel if the address of the terminal that is carried in the second downlink data received by the receiving unit 11 successfully matches the address of the terminal that is sent by the control plane gateway.

When the address of the terminal that is carried in the second downlink data matches the address of the terminal that is sent by the control plane gateway, it may be determined that the MAC address table in the switch has been updated. In this case, the target user plane gateway may release the transmission channel between the source user plane gateway and the target user plane gateway.

In another embodiment provided in the present application, the address of the terminal includes at least one of an IP address of the terminal and a MAC address of the terminal.

In another embodiment provided in the present application, the receiving unit 11 is further configured to obtain, based on the address of the terminal, an ARP packet sent by the terminal; or the processing unit 12 is further configured to generate an ARP packet including the address of the terminal.

In another embodiment provided in the present application, the address of the terminal is the IP address.

The sending unit 13 is further configured to send an ARP request message to the terminal, where the ARP request message includes the IP address of the terminal and a source MAC address, and the source MAC address is a broadcast MAC address.

The receiving unit 11 is further configured to receive the ARP packet sent by the terminal, where the ARP packet carries a destination MAC address of the terminal, and the destination MAC address is the source MAC address included in the ARP request message.

In another embodiment provided in the present application, the receiving unit 11 is further configured to receive a free ARP packet sent by the terminal, where if the free ARP packet carries the address of the terminal, the free APR packet is the ARP packet sent by the terminal.

In another embodiment provided in the present application, the target user plane gateway is located in an evolved packet system EPS, and the Ethernet interface is an SGi interface; or the target user plane gateway is located in a next generation NexGen system, and the Ethernet interface is an NG6 interface.

In an optional embodiment, the processing unit 12 may be a processor 510, and the receiving unit 11 and the sending unit 13 may be a communications interface 520. In addition, the user plane gateway may further include a memory 530. The memory 530 is configured to store program code and data of the user plane gateway. Specifically, as shown in FIG. 13, the user plane gateway includes the processor 510, the communications interface 520, and the memory 530.

In an implementation of the foregoing embodiments, an embodiment of the present application further provides a control plane gateway. When the control plane gateway switches a user plane gateway communicating with a terminal from a source user plane gateway to a target user plane gateway, the control plane gateway may be configured to perform an action performed by the control plane gateway in the foregoing method embodiments. As shown in FIG. 14, the control plane gateway includes: a processing unit 21, configured to obtain a MAC address of the terminal; and a sending unit 22, configured to send, to the target user plane gateway, the MAC address of the terminal that is obtained by the processing unit 21.

In an optional embodiment, the sending unit 22 may be a communications interface 520. In addition, the control plane gateway may further include a memory 530. The memory 530 is configured to store program code and data of the control plane gateway. Specifically, as shown in FIG. 13, the control plane gateway includes a processor 510, the communications interface 520, and the memory 530.

It may be understood that the present application may be applied to environments or configurations of a plurality of universal or dedicated computing systems, for example, a personal computer, a server computer, a handheld device or a portable device, a flat panel device, a multi-processor system, a microprocessor-based system, a set-top box, a programmable consuming electronic device, a network PC, a minicomputer, a mainframe computer, and a distributed computing environment including any one of the foregoing systems or devices.

The present application can be described in the general context of computer-executable instructions executed by a computer, for example, a program module. Generally, the program module includes a routine, a program, an object, a component, a data structure, and the like for executing a particular task or implementing a particular abstract data type. The present application may also be practiced in distributed computing environments in which tasks are performed by remote processing devices that are connected through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including storage devices.

It should be noted that in this specification, relational terms such as “first” and “second” are only used to distinguish one entity or operation from another, and do not necessarily require or imply that any actual relationship or sequence exists between these entities or operations. Moreover, the term “include”, “comprise”, or their any other variant is intended to cover a non-exclusive inclusion, so that a process, a method, an article, or a device that includes a list of elements not only includes those elements but also includes other elements that are not expressly listed, or further includes elements inherent to such a process, a method, an article, or a device. An element preceded by “includes a . . . ” does not, without more constraints, preclude the presence of additional identical elements in the process, method, article, or device that includes the element.

A person skilled in the art can easily figure out another implementation solution of the present application after considering the specification and practicing the present application disclosed herein. This application is intended to cover any variations, functions, or adaptive changes of the present application. These variations, functions, or adaptive changes comply with general principles of the present application, and include common knowledge or a commonly used technical means in the technical field that is not disclosed in the present application. The specification and the embodiments are merely considered as examples, and the actual scope and the spirit of the present application are pointed out by the following claims.

It should be understood that the present application is not limited to the accurate structures that are described in the foregoing and that are shown in the accompanying drawings, and modifications and changes may be made without departing from the scope of the present application. The scope of the present application is limited only by the appended claims. 

What is claimed is:
 1. A data migration method, wherein the method is applied to a scenario in which a user plane gateway communicating with a terminal is changed from a source user plane gateway to a target user plane gateway, and the method comprises: receiving, by the target user plane gateway, an address of the terminal from a control plane gateway; obtaining, by the target user plane gateway, an Ethernet data packet comprising the address of the terminal; and sending, by the target user plane gateway through an Ethernet interface, the Ethernet data packet to a switch to update an address list of the switch.
 2. The method according to claim 1, wherein the Ethernet data packet comprises uplink data from the terminal or an Address Resolution Protocol (ARP) packet.
 3. The method according to claim 1, wherein the address list of the switch is a Media Access Control (MAC) address table.
 4. The method according to claim 1, wherein the method further comprises: receiving, by the switch, the Ethernet data packet from the target user plane gateway; and updating, by the switch, the address list of the switch based on the Ethernet data packet.
 5. The method according to claim 1, wherein the address of the terminal comprises a MAC address of the terminal.
 6. The method according to claim 1, wherein the Ethernet data packet comprises an ARP packet, and the obtaining, by the target user plane gateway, an Ethernet data packet comprises: generating, by the target user plane gateway, the ARP packet comprising the address of the terminal.
 7. The method according to claim 1, wherein the target user plane gateway is located in an evolved packet system (EPS), and the Ethernet interface is an SGi interface; or the target user plane gateway is located in a next generation (NexGen) system, and the Ethernet interface is an NG6 interface.
 8. A target user plane gateway, applied to a scenario in which a user plane gateway communicating with a terminal is changed from a source user plane gateway to the target user plane gateway, wherein the target user plane gateway comprises: at least one processor and a memory, wherein the memory is configured to store a program, and the at least one processor runs the program in the memory to: receive an address of the terminal from a control plane gateway; obtain an Ethernet data packet comprising the address of the terminal; and send, through an Ethernet interface, the Ethernet data packet to a switch to update an address list of the switch.
 9. The target user plane gateway according to claim 8, wherein the Ethernet data packet comprises uplink data from the terminal or an Address Resolution Protocol (ARP) packet.
 10. The target user plane gateway according to claim 8, wherein the address list of the switch is a Media Access Control (MAC) address table.
 11. The target user plane gateway according to claim 8, wherein the address of the terminal comprises a MAC address of the terminal.
 12. The target user plane gateway according to claim 8, wherein the Ethernet data packet comprises an ARP packet, and the at least one processor is further configured to: generate the ARP packet comprising the address of the terminal.
 13. The target user plane gateway according to claim 8, wherein the target user plane gateway is located in an evolved packet system (EPS), and the Ethernet interface is an SGi interface; or the target user plane gateway is located in a next generation (NexGen) system, and the Ethernet interface is an NG6 interface.
 14. A communication system, wherein the system is applied to a scenario in which a user plane gateway communicating with a terminal is changed from a source user plane gateway to a target user plane gateway, and the system comprising: a control plane gateway and the target user plane gateway; the control plane gateway is configured to obtain an address of a terminal; and send the address of the terminal to the target user plane gateway; and the target user plane gateway is configured to obtain an Ethernet data packet comprising the address of the terminal, and send, through the Ethernet interface, the Ethernet data packet to a switch to update an address list of the switch.
 15. The system according to claim 14, the system further comprises the switch, and the switch is configured to obtain the Ethernet data packet through the Ethernet interface, and update the address list of the switch based on the Ethernet data packet.
 16. The system according to claim 14, wherein the Ethernet data packet comprises uplink data from the terminal or an Address Resolution Protocol (ARP) packet.
 17. The system according to claim 14, wherein the address of the terminal comprises a Media Access Control (MAC) address of the terminal.
 18. The system according to claim 14, wherein the Ethernet data packet comprises an ARP packet, and the target user plane gateway is further configured to: generate the ARP packet comprising the address of the terminal.
 19. The system according to claim 14, wherein the target user plane gateway is located in an evolved packet system (EPS), and the Ethernet interface is an SGi interface; or the target user plane gateway is located in a next generation (NexGen) system, and the Ethernet interface is an NG6 interface. 